package com.bl.feignclient;

import com.bl.domain.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

// 指定此接口为feign接口，值为调用服务的引用名称
@FeignClient(value = "user-server",fallbackFactory = UserFallbackFactory.class)
// 被调用方的一级路径
@RequestMapping("/user")
public interface UserFeignClient {

    @GetMapping("/getById/{id}")
    User geById(@PathVariable("id") Long id);


    @GetMapping("/findAll")
    List<User> findAll();

}
